{% extends "sitebase.html" %}

{% block title %}
{{ NEW_TITLE }}
{% endblock %}

{% block menu_3 %}
class="active"
{% endblock %}

{% block header_title %}
{{ NEW_TITLE }}
{% endblock %}

{% block extra_css_inline %}
	.hero-unit {
			padding: 20px;
	}
{% endblock %}

{% block content_inside %}
<div class="row">
	<div class="span16">
{% if not results %}
		<div class="hero-unit">
			<form action="/search/" method="get">
					<input class="input-medium" type="text" placeholder="Building Name" name="name">
					<input class="input-medium" type="text" placeholder="Square Footage" name="sqft">
					<input class="input-medium" type="text" placeholder="Year Built" name="year">
					<button class="btn" type="submit">Go</button>
			</form>
		</div>
{% endif %}
{% if results %}
	<h2>Results: </h2>
      <table class="bordered-table zebra-striped">
        <thead>
          <tr>
            <th>Building Name</th>
            <th>Square Footage</th>
            <th>Year Built</th>
   			<th>Portal Page</th>
          </tr>
        </thead>
        <tbody>
{% for building in results|dictsort:"longname" %}

          <tr>
            <td>{{ building.longname }}</td>
            <td>{{ building.stats_sqft }}</td>
            <td>{{ building.stats_yearBuilt }}</td>
            <td><a href="/buildings/{{ building.shortname }}">Click here</a></td>
          </tr>

{% endfor %}
        </tbody>
      </table>

		<div class="hero-unit">
			<form action="/search/" method="get">
					<input class="input-medium" type="text" placeholder="Building Name" value="{{ namequery }}" name="name">
					<input class="input-medium" type="text" placeholder="Square Footage" value="{{ sqftquery }}" name="sqft">
					<input class="input-medium" type="text" placeholder="Year Built" value="{{ yearquery }}" name="year">
					<button class="btn" type="submit">Go</button>
			</form>
		</div>


{% endif %}
	</div>
</div>
{% endblock %}
